import 'package:fish_redux/fish_redux.dart';

enum PatrolOrderListViewAction {
  action,
  onGetData,
  onTapSort,
  setSort,
  onLoad,
}

class PatrolOrderListViewActionCreator {
  static Action onAction() {
    return const Action(PatrolOrderListViewAction.action);
  }

  static Action onGetData(data, page, tag) {
    return Action(
      PatrolOrderListViewAction.onGetData,
      payload: {'items': data, 'page': page, 'tag': tag},
    );
  }

  static Action onTapSort(index) {
    return Action(PatrolOrderListViewAction.onTapSort, payload: index);
  }

  static Action setSort(index) {
    return Action(PatrolOrderListViewAction.setSort, payload: index);
  }

  static Action onLoad(page, tag) {
    return Action(PatrolOrderListViewAction.onLoad,
        payload: {'page': page, 'tag': tag});
  }
}
